import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { Application } from '../../application/entities/application.entity';
@Entity()
export class User {
  @PrimaryGeneratedColumn()
  uid: number;

  @Column({ unique: true, nullable: true })
  account?: string;

  @Column({ unique: true, nullable: true })
  email?: string;

  @Column()
  password: string;

  @Column({ nullable: true })
  nickname?: string;

  @Column({ nullable: true })
  avatar?: string;

  @Column({ unique: true, nullable: true })
  wechatOpenid?: string;

  @OneToMany(() => Application, application => application.user)
  applications: Application[];
}
